<div class="modal-body no-p">
    <div class="row">
        <div class="col-xs-12">
            <section class="panel panel-primary no-b">
                <header class="panel-heading clearfix brtl brtr">
                    <div class="overflow-hidden">
                        <a href="javascript:;" class="h4 show no-m pt5">添加应用</a>
                    </div>
                </header>
                <div class="row mb10" style="text-align: center;padding-top: 10px;">
                    <table width="80%" style="padding: 10px;">
                        <tr style="height: 30px;">
                            <td width="30%" align="right">应用名称：</td>
                            <td width="70%" align="left">
                                <input type="text" id="appName" name="appName" class="control-group" placeholder="应用名称">
                            </td>
                        </tr>
                    </table>
                </div>
            </section>

        </div>
    </div>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">取 消</button>
    <button onclick="doIt()" id="ok" type="button" class="btn btn-primary" data-loading-text="正在提交...">确 定</button>
</div>
<script type="text/javascript">
    function doIt() {
        if ($("#appName").val() == "") {
            Toast.error("应用名称不可为空");
            $("#appName").focus();
            return false;
        }
        var btn = $("#ok");
        var dialog = $("#dialogDetail");
        btn.button("loading");
        $.post("${base}/platform/sys/api/addDo", {appName: $("#appName").val()}, function (data) {
            if (data.code == 0) {
                Toast.success("添加成功");
                dialog.modal("hide");
                datatable.ajax.reload();
            } else {
                Toast.error(data.msg);
            }
            btn.button("reset");

        }, "json");
    }
</script>
